<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMobileRechargeOrderDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mobile_recharge_order_detail', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('recharge_order_id')->comment('充值订单id');
            $table->string('mobile')->comment('手机号');
            $table->unsignedInteger('user_id')->comment('用户id');
            $table->unsignedInteger('current_month')->default(0)->comment('当前月数');
            $table->unsignedInteger('total_month')->comment('总月数');
            $table->unsignedDecimal('amount')->comment('充值金额');
            $table->unsignedInteger('result_status')->default(0)->comment('充值状态0未充值1成功2出错');
            $table->string('result',200)->nullable()->comment('报错原因');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mobile_recharge_order_detail');
    }
}
